<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>vue3-escook</title>
  <link rel="stylesheet" href="./lib/style.css">
  <script type="importmap">
    {
      "imports" : {
        "vue": "./lib/vue-3.4.29.js"
      }
    }
  </script>
  <script type="module">
    import { createApp, ref } from 'vue'

    const app = createApp({
      setup() {
        const list = ref([
          { id: 1, name: '张三' },
          { id: 2, name: '李四' },
          { id: 3, name: '小白' },
        ])

        return {
          list
        }
      }
    })

    app.mount('#app')
  </script>
</head>

<body>
  <div id="app">
    <ul>
      <template v-for="(item, i) in list">
        <li :id="'list-item-' + item.id">
          <span>索引是：{{ i }}；</span>
          <span>姓名是：{{ item.name }}；</span>
          <span>id 是：{{ item.id }}</span>
        </li>
        <li style="list-style: none;" v-if="i !== list.length - 1">-----------------</li>
      </template>
    </ul>
  </div>
</body>

</html>